﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Koopakiller.Numerics.FormulaSolver
{
    /// <summary>
    /// Provides data for the <see cref="Koopakiller.Numerics.FormulaSolver.FormulaCalculator.ValueCalculated"/> event.
    /// </summary>
    public sealed class FormulaCalculatedEventArgs : EventArgs
    {
        /// <summary>
        /// Gets the identifier of the formula.
        /// </summary>
        public FormulaIdentifier Identifier { get; private set; }
        /// <summary>
        /// Gets the symbol of the result of the formula.
        /// </summary>
        public string ValueSymbol { get; private set; }
        /// <summary>
        /// Gets a list with the current values.
        /// </summary>
        public Dictionary<string, double?> Values { get; private set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="FormulaCalculatedEventArgs"/> class.
        /// </summary>
        /// <param name="identifier">The identifier of the formula.</param>
        /// <param name="valueSymbol">The symbol of the result of the formula.</param>
        /// <param name="values">The new values after calculating the formula.</param>
        internal FormulaCalculatedEventArgs(FormulaIdentifier identifier, string valueSymbol, Dictionary<string, double?> values)
        {
            this.Identifier = identifier;
            this.ValueSymbol = valueSymbol;
            this.Values = values;
        }
    }
}
